//var srl=document.getElementsByClassName("srl")[0];
//var img=srl.getElementsByTagName("img");
//var imgLength=img.length;
//var point=document.getElementsByClassName("box")[0].getElementsByTagName("ul")[0].getElementsByTagName("li");
//var count=0;
//var left=srl.offsetLeft;
//var timer;
//srl.innerHTML+=srl.innerHTML;
//img=srl.getElementsByTagName("img");
//for(var i=0;i<imgLength;i++)
//{
//    point[i].idx=i;
//    img[i].onload=function(i)
//    {
//
//        move(i);
//    }
//    point[i].onclick=function () {
//        count=this.idx;
//        console.log(count);
//        left=img[count].offsetLeft*-1;
//        move(i);
//    }
//}
//
//
//function move(){
//    clearInterval(timer);
//    timer=setInterval(function(){
//        if (left<-1*img[imgLength].offsetLeft){
//          left=0;count=0
//        }
//        for(var j=0;j<imgLength;j++)
//        if(left==img[j].offsetLeft*(-1))
//        {
//            count=j;
//        }
//        srl.style.left=left+"px";
//        left-=1;
//
//    },5);
//    for (var n=0;n<point.length;n++)
//    {
//        point[n].className="";
//    };
//    point[count].className="active";
//}

function animation(obj,tProperty,time)
{
    function fth(element,pro)
    {
        if(window.getComputedStyle!=-1){
            return getComputedStyle(element).getPropertyValue(pro);
        }
        else{
            return ele.currentStyle[pro];
        }
    }
    var container={};
    var change={};
    var count=0;
    var times=0
    var interval;
    var timer;
    if(window.navigator.userAgent.indexOf("MSIE")==-1)
    {interval=10}
    else{interval=50};
    times=time/interval;
    for(var k in tProperty)
    {
        container[k]=parseFloat(fth(obj,k));
        tProperty[k]=parseFloat(tProperty[k]);
        change[k]=(tProperty[k]-container[k])/times;

    }

    timer=setInterval(function ()
    {
        for(var j in container) {
            container[j] += change[j];

            if (j == "opacity") {
                obj.style[j] = container[j];
                obj.filter = "alpha(opacity=" + container[j] * 100 + ")"
            }
            else {
                obj.style[j] = container[j] + "px";
            }
            console.log(obj[j]);
        }
        count++;
        if(count==times)
        {
            for(var j in container) {
                container[j] = tProperty[j];
                if (j = "opacity") {
                    obj.style[j] = container[j];
                    obj.filter = "alpha(opacity=" + container[j] * 100 + ")"
                } else {
                    obj.style[j] = container[j] + "px";
                }
            }
            clearInterval(timer);
        }
    },interval);
}
var a=document.getElementById("move");
animation(a,{"left":"1500px","top":"1000px"},7000);